from django.conf.urls import url, include
from . import views

urlpatterns = [
    url(r'^books/$', views.BooksListAPIView.as_view()),
    url(r'^books/(?P<book_id>\d+)/$', views.BooksDetailAPIView.as_view()),

    url(r'^books_generic/$', views.BooksListGenericView.as_view()),
    url(r'^books_generic/(?P<book_id>\d+)/$', views.BooksDetailGenericView.as_view()),

    url(r'^books_generic_mixin/$', views.BookListMixinView.as_view()),
    url(r'^books_generic_mixin/(?P<book_id>\d+)/$', views.BookDetailMixinView.as_view()),

    url(r'^books_third/$', views.BookListThirdView.as_view()),
    url(r'^books_third/(?P<book_id>\d+)/$', views.BookDetailThirdView.as_view()),

    url(r'^books_viewset/$', views.BookGetViewSet.as_view({'get': 'list'})),
    url(r'^books_viewset/(?P<book_id>\d+)/$', views.BookGetViewSet.as_view({'get': 'retrieve'})),

    url(r'^books_readonly_viewset/$', views.BookReadOnlyViewSet.as_view({'get': 'list'})),
    url(r'^books_readonly_viewset/(?P<book_id>\d+)/$', views.BookReadOnlyViewSet.as_view({'get': 'retrieve'})),

    url(r'^books_model_viewset/$', views.BookModelViewSet.as_view({'get': 'list', 'post': 'create'})),
    url(r'^books_model_viewset/(?P<book_id>\d+)/$', views.BookModelViewSet.as_view({'get': 'retrieve', 'put': 'update', 'delete': 'destroy'})),
    url(r'^books_model_viewset/bread/$', views.BookModelViewSet.as_view({'get': 'filter_bread'})),
    url(r'^books_model_viewset/bread/(?P<pk>\d+)/$', views.BookModelViewSet.as_view({'patch': 'update_bread'})),

]